package _09练习;

public class Student {
	// prviate 私有的
			private String name;
			private int age;
			private int height;
			
			// Setter方法 setXXX
			public void setName(String name)
			{
				this.name = name;
			}
			
			public void setAge(int age)
			{
				if(age>130 || age<1)
				{
					System.err.println("错误的年龄");
					this.age = 18;
					return;
				}
				this.age = age;
			}
			public void setHeight(int height)
			{
				if(height>280.9 || height<1)
				{
					System.err.println("错误的身高");
					this.height = 185;
					
					return;
				
				}
				this.height= height;
			}
			
			// Getter 方法 getXXX
			public String getName()
			{
				return this.name;
			}
			
			public int getAge()
			{
				return this.age-2;
			}
			
			// boolean类型的get方法  isXXX
			public float getHeight()
			{
				return this.height;
			}

			
	
			

			@Override
			public String toString() {
				return "Student [name=" + name + ", age=" + age + ", height=" + height + "]";
			}





			
			//有参
			public Student(String name, int age, int height) {
				super();
				this.name = name;
				this.age = age;
				this.height = height;
			}
			
			
			public Student() {
				super();
				// TODO Auto-generated constructor stub
			}
			
			static int count;
			public void printCount()
			{
				System.out.println("学生总数是："+count);
			}
			

}
